<!DOCTYPE>
<html>
<head>
<script src='../trunk/Weiran.js'></script>
<script src='../trunk/Grub.js'></script>
</head>
<body>
<pre id="log">
</pre>
<script>
    function log(str) {
        var logger = document.getElementById('log');
        logger.innerHTML += str + ('\n');
    }
    
    log('start');
    
    Weiran.require('http://jpp.googlecode.com/svn/soundmanager/soundmanager2.min.js', function(err) {
        if (err) {
            log(err);
            return;
        }
        
        soundManager.setup({
            url: 'swf/',
            flashLoadTimeout: 10000,
            flashVersion: 9,

            onready: function() {

                soundManager.createSound({
                    id:'foo',
                    url:'http://fanghuanweiran.googlecode.com/svn/trunk/theme/default/img/default_device_alarm.mp3'
                }).play();

                log('started OK');
  
            },

            ontimeout: function() {
                log('Loaded OK, but unable to start: unsupported/flash blocked, etc.');
            }
        });
        
        soundManager.beginDelayedInit();
    });
</script>
</body>
</html>
